﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace ObjectFeatures
{
    class Program
    {
        public static void Main(string[] args)
        {
            Worker worker = new Worker();
            worker.Start();

            Timer t = new Timer(9);
            t.Finished += PrintTimerFinished;
            worker.StartTimer(t);

            while (worker.Timers.Count > 0) {
                Thread.Sleep(1000);
                Console.Write(".");
            }
            worker.Stop();
            Console.WriteLine("All timers finished");
            Console.ReadKey(false);
        }
        public static void PrintTimerFinished(object sender, EventArgs evt) {
            Console.WriteLine("\r\nTimer finished : "+sender);
        }
    }
}
